const a=document.getElementById("box");
const b=document.getElementById("box2");

const c=document.createElement("p");
c.textContent="你好，欢迎你！";
a.replaceWith(c);

const d=document.createElement("p");
d.textContent="你好，我也欢迎你！";

b.replaceChildren(d);